package src.multithreading;
//合并线程
public class JoinTest implements Runnable{
    public static void main(String[] args) throws InterruptedException{
        JoinTest joinTest = new JoinTest();
        Thread thread = new Thread(joinTest);
        thread.start();
        for (int i = 0; i < 10; i++) {
            if(i==5){
                thread.join();
            }
            System.out.println("main..."+i);
        }
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println("join...."+i);
        }
    }
}
